<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Utils;

use Qiniu\Auth;

class Qiniu
{
    public static function getDownLoadurl($fileName)
    {
        if (! empty($fileName)) {
            $auth = new Auth(env('QINIU_ACCESS_KEY'), env('QINIU_SECRET_KEY'));
            $url = env('QINBIU_DOMAIN') . '/' . $fileName;
            return $auth->privateDownloadUrl($url);
        }
        return env('API_DOMAIN') . 'image/default.jpg';
    }
}
